<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>报告页面</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 20px;
            margin: 0;
        }

        .report-container {
            background-color: #fff;
            padding: 30px;
            border-radius: 10px;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            width: 90%;
            max-width: 800px;
            margin-bottom: 20px;
            box-sizing: border-box;
        }

        .report-container h2 {
            color: #333;
            margin-bottom: 20px;
            text-align: center;
        }

        .image-section {
            text-align: center;
            margin-bottom: 20px;
        }

        .image-section img {
            max-width: 100%;
            height: auto;
            border-radius: 5px;
            box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        }

        .analysis-section {
            line-height: 1.6;
            color: #666;
            margin-bottom: 20px;
        }

        .button-section {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .button-section button {
            padding: 10px 20px;
            margin: 5px 0;
            background-color: #007BFF;
            color: #fff;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            transition: background-color 0.3s ease;
            width: 100%;
            box-sizing: border-box;
        }

        .button-section button:hover {
            background-color: #0056b3;
        }

        .logout-link {
            margin-top: 0px;
            text-align: center;
        }

        .logout-link a {
            color: #007BFF;
            text-decoration: none;
        }

        .logout-link a:hover {
            text-decoration: underline;
        }

        /* 媒体查询，针对小屏幕设备（如手机）进行优化 */
        @media (max-width: 480px) {
            .report-container {
                padding: 20px;
            }

            .analysis-section {
                font-size: 14px;
            }
        }
        .header-image {
            text-align: center;
            margin-bottom: 20px;
        }
    </style>
    <script src="https://cdn.socket.io/4.4.1/socket.io.min.js"></script>
    <script>
        var socket = io.connect('http://' + document.domain + ':' + location.port);
        socket.on('connect', function() {
            console.log('Connected to server');
        });
        socket.on('update_report', function(data) {
            document.getElementById('deepseek_result').innerHTML = data.result;
        });
    </script>
</head>
<body>
<div class="report-container">
    <div class="header-image">
        <img src="{{ url_for('static', filename='/images/libImgHeader.png') }}" alt="Header Image"
             style="max-width: 100%; height: auto;">
    </div>
    <h2 align="center">您本次的报告</h2>
    <p>经大模型初步分析结果: {{ analysis }}</p>
    {% if image_path %}
    <div class="image-section">
        <img src="{{ url_for('static', filename=image_path) }}" alt="体验图片">
    </div>
    {% endif %}

    <p id="deepseek_result">{{ deepseek_result }}</p>
    <div class="button-section">
        <button onclick="window.location.href='{{ url_for('update_report') }}'">更新报告</button>
        <button onclick="window.location.href='{{ url_for('re_assessment') }}'">再次测评</button>
    </div>
</div>
<div class="logout-link">
    <a href="{{ url_for('logout') }}">注销</a>
</div>
</body>
</html>